<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<style>
  #person-1{
    width: 100px;
    height: 100px;
    background-color: #00ff00;
  }
  #person-2{
    width: 100px;
    height: 100px;
    background-color: #00ffff;
  }
  #person-0{
    width: 100px;
    height: 100px;
    background-color: #0000ff;
  }
</style>
<body>
<div id="app">
  <div v-for="(item,i) in id_list ">
    <div :id="generateId(i)"></div>
  </div>
</div>
<script>
  new Vue({
    el:"#app",
    data(){
      return{
        id_list:[
                "哈哈",
                "星星",
                "存储",
        ]
      }
    },
    methods:{
      generateId(i){
        console.log()
        return "person-"+i
      }
    }
  })
</script>
</body>
</html>
